﻿
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sproc_AddDocument]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [dbo].[sproc_AddDocument];
GO
CREATE PROCEDURE [dbo].[sproc_AddDocument] 
    @ClassID int,
    @DocTitle As nvarchar(300), 
    @DocContent As ntext, 
    @DocApprover As nvarchar(300), 
     @DocApproveDate As Datetime, 
    @DocApproved As int, 
     @DocType As Int, 
            @DocAttribute As int, 
    @DocAddedBy As nvarchar(300), 
    @DocAddedDate As Datetime
/*
=================================================
功能:    新增文档主体记录
参数:    
    @ClassID         文档所属项目
    @DocTitle         文档标题
    @DocContent         文档正文
    @DocApprover         文档审批人
     @DocApproveDate    文档被审批日期
    @DocApproved     文档是否被审批
     @DocType         文档类型
            @DocAttribute         文档属性(暂未使用)
    @DocAddedBy         文档上传人
    @DocAddedDate     文档上传日期
=================================================
*/
AS
SET NOCOUNT ON
INSERT INTO UDS_document 
        (ClassID,DocTitle,DocContent,DocApprover,DocApproveDate,DocApproved,DocType,DocAttribute,DocAddedBy,DocAddedDate)
    VALUES (@ClassID,@DocTitle,@DocContent,@DocApprover,@DocApproveDate,@DocApproved,@DocType,@DocAttribute,@DocAddedBy,@DocAddedDate)
    SELECT @@IDENTITY AS DocID
SET NOCOUNT OFF